<div class="admin_right_top"><{$lang.advs_service}></div>
<{if $re}>
<style>
	table th{font-weight:bold;}
	table th,table td{text-align:center; padding:5px;}
</style>
<form action="" method="post">
	<table cellspacing="1" cellpadding="4" border="0" bgcolor="#FFFFFF" style="display:table; width:100%;">
    <tr bgcolor="#E8E8E8"><th width="250px" style="text-align:left;"><{$lang.adv_name}></th>
    <th><{$lang.adv_ptime}></th><th><{$lang.adv_buy_unit}></th><th width="150px"><{$lang.statu}></th><th width="150px"><{$lang.adv_atime}></th></tr>
     <{foreach item=list from=$re}>
    <tr  bgcolor="#F7F7F7" id="<{$list.ID}>">
    	<td style="text-align:left"><{$list.name}></td>
        <td><{$list.ctime|date_format:'%Y-%m-%d'}></td>
        <td><{$list.show_time}><{$lang[$list.unit]}></td>
        <td>
        <{if $list.statu==0}>
        	<{$lang.audit}>&nbsp;<a href="javascript:cannelAdv(<{$list.ID}>);"><{$lang.cannel}></a>
        <{elseif $list.statu<0}>
        	<{$lang.audit_nopass}>&nbsp;<a href="?menu=trade&action=admin_accounts_cashflow&menu=trade">(<{$lang.refund_money}>)</a>
        <{else}>
            <{if $list.etime>0&&$list.etime<$smarty.now}>
            	<{$lang.adv_outtime}>
            <{elseif $list.statu>0}>
            	<a href="main.php?action=admin_adv&type=<{$list.type}>&menu=<{$smarty.get.menu}>&id=<{$list.ID}>"><{$lang.adv_admin}></a>
            <{/if}>
        <{/if}>
        </td>
        <td>
        <{if $list.statu>0&&$list.isopen==1}>
        <{if $list.stime>0&&$list.etime>0}><{$list.stime|date_format:'%Y-%m-%d'}>至<{$list.etime|date_format:'%Y-%m-%d'}><{/if}>
        <{elseif $list.statu>0}>
       <{$lang.adv_open_statu}>
        <{/if}>
        </td>
    </tr>
    <{/foreach}>
    </table>
</form><br />
<a href="ads_services.php" target="_blank"><{$lang.advs_list}></a>
<{else}>
<p style="padding:30px 0px 0px 20px; color:#666;">
<{$lang.adv_service_tip}><a href="ads_services.php" target="_blank"><{$lang.advs_list}></a>
</p>
<{/if}>

<script>
function cannelAdv(v)
{	
	var url = window.location.href;
	var sj = new Date();
	var pars = 'oper=ajax&act=cannel&shuiji=' + sj+'&id='+v;
	var myAjax = new Ajax.Request(
				url,
				{method: 'post', parameters: pars, onComplete: showResponse}
				);
	function showResponse(originalRequest)
	{
		var str = 'var data = ' + originalRequest.responseText; 
		eval(str);
		if(data>0)
			window.location.href = window.location.href;
		else
			alert('<{$lang.adv_try_again}>');	
	}
}
</script>